﻿@model TestUp.Models.AdminModels.EditPendingTestModel
@{
    ViewBag.Title = "EditPendingTest";
    Layout = "~/Views/Admin/_AdminLayout.cshtml";
}

<h2>Edit Pending Test</h2>
@using (Html.BeginForm("EditPendingTest", "Admin"))
{
    <fieldset>
        <legend>Edit existing Pending Test</legend>
        <div class="editor-label">
            @(Html.LabelFor(x => x.PendingTest.GroupId))
        </div>
        <div class="editor-field">
            @(Html.Kendo().ComboBoxFor(x => x.PendingTest.GroupId)
          .Placeholder("Select group...")
          .DataTextField("GroupName")
          .DataValueField("GroupId")
          .BindTo(Model.Groups)
          .Suggest(true)
          .SelectedIndex(Model.PendingTest.GroupId)
        )
        </div>


        <div class="editor-label">
            @(Html.LabelFor(x => x.PendingTest.Test.TestName))
        </div>
        <div class="editor-field">
            @(Html.Kendo().ComboBoxFor(x => x.PendingTest.TestId)
          .Placeholder("Select test...")
          .DataTextField("TestName")
          .DataValueField("TestId")
          .BindTo(Model.Tests)
          .Suggest(true)
          .SelectedIndex(Model.PendingTest.TestId)
        )
        </div>


        <div class="editor-label">
            @(Html.LabelFor(x => x.PendingTest.ExpirationDate))
        </div>
        <div class="editor-field">
            @(Html.Kendo().DateTimePickerFor(x=>x.PendingTest.ExpirationDate)
            .Min(DateTime.Now)
            )
        </div>
        

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "ViewPendingTests")
</div>
